<template>
  <div class="box-title-wrapper flex jc-sb ai-c">
    <div class="title flex ai-c">
      {{ title }}
      <div class="sub-title" v-show="subTitle">{{ subTitle }}</div>
    </div>
    <slot></slot>
  </div>
</template>
<script>
/**
 * BoxTitle-头部组件  2021/11/25
 * @author xu
 * @param {String} title 标题
 * @param {subTitle} noTitle 副标题
 * @slot 填充自定义内容
 */
export default {
  name: 'BoxTitle',
  props: {
    title: {
      type: String,
      default: '标题',
    },
    subTitle: {
      type: String,
      default: '',
    },
  },
};
</script>
<style lang="scss" scoped>
.box-title-wrapper {
  height: 40px;
  background-image: url('../../../assets/images/bg/box-title.png');
  background-size: auto 100%;
  background-repeat: no-repeat;
  padding-left: 60px;
  padding-bottom: 4px;

  .title {
    font-family: Source Han Sans CN, Source Han Sans CN;
    font-weight: bold;
    font-size: 20px;
    letter-spacing: 2px;
    color: #ffffff;
    margin-left: 8px;
    .sub-title {
      font-weight: normal;
      font-size: 14px;
      background: #10ac75;
      border-radius: 2px 2px 2px 2px;
      padding: 0 4px;
      line-height: 20px;
      height: 20px;
      margin-left: 16px;
    }
  }
}
</style>
